//
//  PaperReportHeaderView.swift
//  Exam-iOS
//
//  Created by 李胜锋 on 2018/3/15.
//  Copyright © 2018年 李胜锋. All rights reserved.
//

import Foundation
import UIKit

class PaperReportHeaderView: UICollectionReusableView {
    
    var label: UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setup()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    func set(_ title: String) {
        label.text = title
    }
    
    private func setup() {
        self.backgroundColor = UIColor.white
        _ = UIView().then({ (view) in
            view.backgroundColor = Config.default.grayLineViewColor
            addSubview(view)
            view.snp.makeConstraints({ (maker) in
                maker.height.equalTo(0.5)
                maker.top.leading.trailing.equalToSuperview()
            })
        })
        
        label = UILabel().then({ (label) in
            label.font = UIFont.systemFont(ofSize: 14)
            label.textAlignment = .center
            
            addSubview(label)
            label.snp.makeConstraints({ (maker) in
                maker.center.equalToSuperview()
            })
        })
    }
}
